package com.example.smarthome.ui.slideshow;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;

import com.example.smarthome.R;

public class SlideshowFengshanActivity extends AppCompatActivity {


    String model="";
    String wendu="";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_slideshow_fengshan);
        RadioButton radioButton =(RadioButton) findViewById(R.id.cold) ;
        RadioButton radioButton1=(RadioButton) findViewById(R.id.hot) ;
        EditText editText=(EditText) findViewById(R.id.Edix_text_wendu);
        Button button1 = (Button)findViewById(R.id.confirm);
        Button button2= (Button) findViewById(R.id.add);
        Button button3= (Button) findViewById(R.id.reduce);
        wendu= editText.getText().toString();
        model=radioButton.getText().toString();
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.e("输入的温度当前", wendu);
                Log.e("输入的温度当前", model);
            }
        });
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String text= editText.getText().toString();
                int i=Integer.valueOf(text).intValue()+1;
                wendu = Integer.toString(i);
                editText.setText(wendu);
                Log.e("输入的温度当前", text);
            }
        });
        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String text= editText.getText().toString();
                int i=Integer.valueOf(text).intValue()-1;
                wendu = Integer.toString(i);
                editText.setText(wendu);
                Log.e("输入的温度当前", wendu);
            }
        });
        radioButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String text=radioButton.getText().toString();
                model=text;
                Log.e("输入的模式当前", text);
            }
        });
        radioButton1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String text=radioButton1.getText().toString();
                model=text;
                Log.e("输入的模式当前", text);
            }
        });
    }
}